#include "trap.h"
#include "instr_def.h"
#include "instr_test.h"
    .set noreorder
    .globl main
    .text
main:
    li $k1, 0x0
    # (data, base, offset)
    # AddressError
    SH(0x12121256, 0xc, 0x0001) # 1
    nop
    nop
    SH(0x12121256, 0x7, 0x0002) # 2
    nop
    nop
    SLH_TEST(0x00000000, 0x4, 0x0001) # 3
    nop
    nop
    LHU_TEST(0x00000000, 0x4, 0x0001) # 4
    nop
    nop
    LHU_TEST(0x00000000, 0x4, 0x0001) # 5
    nop
    nop
    SW(0x7fffffff, 0x0c, 0x0002) # 6
    nop
    nop
    SLW_TEST(0x00000000, 0x4, 0x0007) # 7
    nop
    nop
    SW(0x2222aaaa, 0x04, 0x0002) # 8
    nop
    nop
    SLW_TEST(0x00000000, 0x1, 0x0000) # 9
    nop
    nop
    SLH_TEST(0x00000000, 0x8, 0x0009) # 10
    nop
    nop
   
    li $k1, 0x12345678
    HIT_GOOD_TRAP		# stop temu   

    .org 0x380
AddressError:
    eret
    
res_error: 
    li $s1, 0x11111111
    HIT_BAD_TRAP		# stop temu   